<html>
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>MixIO</title>
    <link rel="shortcut icon" href="img/shortcut.png"/>
    <!-- Custom fonts for this template-->
    <link rel="stylesheet" href="css/farbtastic.css">
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <link href="css/nunito.css" rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="css/sb-admin-2.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/muuri.css?v=2">
    <link rel="stylesheet" href="css/widgets.css?v=1">
    
    <!-- Bootstrap core JavaScript-->
    <script src="js/jquery.min.js"></script>
    <script src="js/lang.js"></script>
    <script src="js/farbtastic.js"></script>
    <script src="js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <script src="js/jquery.easing.min.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="js/echarts.min.js"></script>
    <script src="js/jquery.easyui.min.js"></script>
    <script src="js/mqtt.min.js"></script>
    <script src="js/gauge.min.js"></script>
    <link rel="stylesheet" href="css/dataTables.bootstrap4.min.css">
    <script src="js/jquery.dataTables.min.js"></script>
    <script src="js/dataTables.bootstrap4.min.js"></script>
    <script>var MAX_PROJECT_NUM_PER_USER = <%=configs['MAX_PROJECT_NUM_PER_USER']%></script>
    <script src="js/tools.js"></script>
    <script src="js/storage.js?v=11"></script>
</head>

<body id="page-top" class="sidebar-toggled">
    <!-- Page Wrapper -->
    <div id="wrapper">

        <!-- Sidebar -->
        <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">

            <!-- Sidebar - Brand -->
            <a class="sidebar-brand d-flex align-items-center justify-content-center" href="/">
                <div class="sidebar-brand-icon">
                    <img src="img/logo.png" style="width:35px" alt="">
                </div>
                <div class="sidebar-brand-text mx-3" >MixIO</div>
            </a>

            <!-- Divider -->
            <hr class="sidebar-divider my-0">

            

            <!-- Nav Item - Dashboard -->

            <!-- Divider -->
            <hr class="sidebar-divider">

            <!-- Heading -->
            <div class="sidebar-heading lang" key="MANAGE">
            </div>
            <li class="nav-item">
                <a class="nav-link" href="projects" id="manage_prj">
                    <i class="fa fa-fw fa-tachometer"></i>
                    <span class="lang" key="PROJECTSMANAGE"></span></a>
            </li>
            <li class="nav-item active">
                <a class="nav-link" href="storage" id="manage_strg">
                    <i class="fa fa-fw fa-database"></i>
                    <span class="lang" key="STORAGEMANAGE"></span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="webapps" id="share_app">
                    <i class="fa fa-fw fa-share"></i>
                    <span class="lang" key="SHAREMANAGE"></span></a>
            </li>

            <hr class="sidebar-divider">
            <div class="sidebar-heading lang" key="SETTINGS">
            </div>
            <li class="nav-item">
                <a class="nav-link" href="logout">
                    <i class="fa fa-fw fa-arrow-circle-left"></i>
                    <span class="lang" key="LOGOUT"></span></a>
            </li>

           

            <!-- Divider -->
            <hr class="sidebar-divider d-none d-md-block">

            <!-- Sidebar Toggler (Sidebar) -->
            <div class="text-center d-none d-md-inline">
                <button class="rounded-circle border-0" id="sidebarToggle"></button>
            </div>

        </ul>
        <!-- End of Sidebar -->

        <!-- Content Wrapper -->
        <div id="content-wrapper" class="d-flex flex-column">

            <!-- Main Content -->
            <div id="content">

                <!-- Topbar -->
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow" style="display:flex;justify-content:space-between">
                    <div style="display:flex;align-items:center;justify-content:center">
                        <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
                            <i class="fa fa-bars"></i>
                        </button>  
                        <h1 class="d-sm-inline-block h3 mb-0 text-gray-800 lang" style="margin-left:10px;font-size:1.25rem;display:inline-block;cursor:pointer" key="STORAGEMANAGE"></h1>
                    </div>
                </nav>
                <div class="container-fluid" id="project_list">
                <div class="card shadow mb-4" style="margin-top:1.5rem;border-radius:10px 10px 30px 30px">
                        <div class="card-body row" style="padding-bottom:0;">
                            <div class="col-xl-6 col-md-6">
                                <h4 class="small font-weight-bold"><span class="lang" key="MANAGECOUNT"></span><span class="float-right" id="prj_num"><%=prjcount%> / <%=configs['MAX_PROJECT_NUM_PER_USER']%></span></h4>
                                <div class="progress mb-4">
                                    <div class="progress-bar bg-warning" role="progressbar" id="prj_num_bar" style="width: <%=prjcount*100/configs['MAX_PROJECT_NUM_PER_USER']%>%" aria-valuenow="<%=prjcount%>" aria-valuemin="0" aria-valuemax="<%=configs['MAX_PROJECT_NUM_PER_USER']%>"></div>
                                </div>
                            </div>
                            <div class="col-xl-6 col-md-6">
                                <h4 class="small font-weight-bold"><span class="lang" key="OFFLINECOUNT"></span><span class="float-right" id="msg_num"><%=count%> / <%=configs['MAX_HOOKED_MESSAGE_NUM_PER_USER']%></span></h4>
                                <div class="progress mb-4">
                                    <div class="progress-bar bg-danger" role="progressbar" id="msg_num_bar" style="width: <%=count*100/configs['MAX_HOOKED_MESSAGE_NUM_PER_USER']%>%" aria-valuenow="<%=count%>" aria-valuemin="0" aria-valuemax="<%=configs['MAX_HOOKED_MESSAGE_NUM_PER_USER']%>"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                <div class="card shadow mb-4">
                        <div class="card-body" style="overflow:auto">
                        <table id="apps_table" class="table table-striped table-bordered" style="width:100%"> 
                        <thead>
                            <tr>
                                <th class='lang' key='PRJNAME'></th>
                                <th class='lang' key='OFFLINECOUNT'></th>
                                <th class='lang' key='OPTIONS'></th>
                            </tr>
                        </thead>
                        <tbody>
                            <% histories.forEach(function(his){ %>
                                        <tr>
                                            <td style="vertical-align:middle"><%=his['key']%></td>
                                            <td style="vertical-align:middle"><%=his['value']%></td>
                                            <td style="vertical-align:middle">
                                            <a class="btn btn-sm btn-success btn-circle" onclick="view_project('<%=his['key']%>','0')" style="margin-right:10px"><i class="fa fa-arrow-right" style="font-size:1rem"></i></a>
                                            <a class="btn btn-sm btn-danger btn-circle <%=(his['value']==0?'disabled':'')%>" onclick="delete_data('<%=his['key']%>','<%=his['value']%>')" style="margin-right:10px"><i class="fa fa-trash" style="font-size:1rem"></i></a></td>
                                        </tr>  
                            <% }); %>
                        </tbody>
                        </table>
                        </div>
                    </div>
                </div>
            </div>
            <footer class="sticky-footer bg-white">
            <div class="container my-auto">
                <div class="copyright text-center my-auto">
                    <span>Copyright &copy; mixio.mixly.org 2021</span>
                </div>
            </div>
    </footer>
        </div>
    
    <!-- End of Page Wrapper -->


    

    <!-- Page level custom scripts -->
    <script src="js/sb-admin-2.min.js?v=2"></script>
</body>

</html>